<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>05变形之旋转</title>
		<style type="text/css">
			#firCan {
				display: block;
				border: 1px solid khaki;
				margin: auto;
			}
		</style>
	</head>
	<body>
		<canvas id="firCan" width="1000" height="500">
			您的浏览器版本过低, 不支持Canvas, 请升级!
		</canvas>
	</body>
	<script type="text/javascript">
		// 1, 获取Canvas
		var firCan = document.getElementById("firCan");
		// 2, 获取 2d渲染上下文
		var context = firCan.getContext('2d');
		
		// 3, 绘制矩形
		context.fillStyle = 'red';
		/*
		 * 旋转: rotate(angle)
		 * 一个参数:
		 * 	angle	坐标系顺时针旋转的 弧度.
		 */
		context.rotate(Math.PI / 4);
		context.fillRect(100, 100, 200, 100);
		
		
	</script>
</html>
